package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @Author fallrain
 * @Description 第四种:通过线程池方法创建
 * 1: 通过ExecutorService创建
 * 2：自定义ThreadPoolExecutor,自己指定线程池七大参数,推荐使用这种方式,方便后期管理
 * @Date 2022/2/22 10:54
 * @Version 1.0
 */
public class CreateByThreadPool {
//    public static void main(String[] args) {
//        ExecutorService executorService = Executors.newSingleThreadExecutor();
//        executorService.submit(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println(Thread.currentThread().getName());
//            }
//        },"线程1");
//        executorService.shutdown();
//    }


    // corePoolSize corePoolSize 库额  噗欧 塞z

    // maximumPoolSize maximumPoolSize 麦克斯 么木 噗欧 塞z

    // keepAliveTime keepAliveTime  ki:p 额赖五

    // unit unit 油内特

    // workQueue 我克  k油

    // threadFactory threadFactory  [θred]  f哎可特瑞

    // handler handler  [ˈhændlə(r)]  含的了


    public static void main(String[] args) {

//        ExecutorService executorService = new ThreadPoolExecutor();
    }
}
